
// ~~

// 参考
// http://www.fly63.com/article/detial/2802
// https://zhidao.baidu.com/question/2266131877883792948.html

// ~~它代表双非按位取反运算符，如果你想使用比Math.floor()更快的方法，那就是它了。需要注意，对于正数，它向下取整；对于负数，向上取整；非数字取值为0，它具体的表现形式为：


// ~~null;      // => 0
// ~~undefined; // => 0
// ~~Infinity;  // => 0
// ~~NaN;       // => 0
// ~~0;         // => 0
// ~~{};        // => 0
// ~~[];        // => 0
// ~~(1/0);     // => 0
// ~~false;     // => 0
// ~~true;      // => 1
// ~~1.9;       // => 1
// ~~-1.9;      // => -1

const fnArr = [() => { let _ = ~~null; console.log('~~null : ', _); },
() => { let _ = ~~undefined; console.log('~~undefined : ', _); },
() => { let _ = ~~Infinity; console.log('~~Infinity : ', _); },
() => { let _ = ~~NaN; console.log('~~NaN : ', _); },
() => { let _ = ~~0; console.log('~~0 : ', _); },
() => { let _ = ~~{}; console.log('~~{} : ', _); },
() => { let _ = ~~[]; console.log('~~[] : ', _); },
() => { let _ = ~~(1/0); console.log('~~(1/0) : ', _); },
() => { let _ = ~~false; console.log('~~false : ', _); },
() => { let _ = ~~true; console.log('~~true : ', _); },
() => { let _ = ~~1.9; console.log('~~1.9 : ', _); },
() => { let _ = ~~-1.9; console.log('~~-1.9 : ', _); }];

fnArr.forEach((fn) => {
    fn.call(null);
});

(() => { let _ = ~~"3.5"; console.log('~~"3.5" : ', _); })();

